/*
 * Monster.h
 *
 *  Created on: 2013. 9. 18.
 *      Author: jjaehuny
 */

#ifndef PROJECTZ_NLOGIC_MONSTER_H_
#define PROJECTZ_NLOGIC_MONSTER_H_

namespace ProjectZ { namespace NLogic {

class Monster
{
public:
	enum class MonsterType {
		__NONE__,

		MONSTER,
		PLAYER_SLAVE,
		MOB_SLAVE,

		__MAX__,
	};

public:
	struct Data {
		int gid;
		int map_index;
		int tid;
		int hp;
		int sp;
		int x;
		int y;
		int degree;
		int level;
		int islegend;
		int isslave;
		int slave_type;

		// for battle pet rebirth
		bool rebirth;
		int rebirth_hp;
		int max_hp;

	public:
		void Clear()
		{
			gid = 0;
			map_index = 0;
			tid = 0;
			hp = 0;
			sp = 0;
			x = 0;
			y = 0;
			degree = 0;
			level = 0;
			islegend = 0;
			isslave = 0;
			slave_type = 0;


			rebirth = false;
			rebirth_hp = 0;
			max_hp = 0;
		}
	};

public:
	Monster();
	virtual ~Monster();

	void Initialize();
	void Finalize();

	bool		Open(Data & clsData, MonsterType monsterType);
	Data &		GetData();

	int ChangeHP(int val);
	int ChangeSP(int val);
	int DecreaseHP(int damage);

	//void			SetMonsterType(MonsterType monsterType);
	MonsterType 	GetMonsterType();

private:
	Data 			_data;
	MonsterType 	_monsterType;
};

} /*NLogic*/ } /* namespace ProjectZ */

#endif /* PROJECTZ_NLOGIC_MONSTER_H_ */
